package com.yanggu.scala.chapater02

object StringDemo {

  def main(args: Array[String]): Unit = {
    //1. 基本数据类型到string
    val d1: Int = 22
    val d2 = 22 + ""
    println(d2)

    //2. String到基本数据类型。调用toXxx方法即可
    val num = "22"
    println(num.toDouble)
    println(num.toInt)
    val num1 = "22.3"
//    println(num1.toInt)
    val num2 = "Hello"
    println(num2.toInt)
  }

}
